package BankManageSystem;

public class Account {
    private double balance;
    private String name;
    private int accountId;
    private int password;

    public Account() {
    }


    public double getBalance() {
        return balance;
    }

    public int getAccountId() {
        return accountId;
    }

    public int getPassword() {
        return password;
    }

    public String getName() {
        return name;
    }

    public void setPassword(int password) {
        this.password = password;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAccountId(int accountId) {
        this.accountId = accountId;
    }

    public void deposit(double money){
        if(money > 0){
            this.balance += money;
            System.out.println("存款成功");
        }else{
            System.out.println("存款失败，请检查存款是否正确");
        }
    }
    public void withdrawal(double money){
        if(money > 0 || money <= balance){
            this.balance -= money;
        }
        if(money < 0){
            System.out.println("取款失败，请检查取款金额是否正确");
        }
        if(money > balance){
            System.out.println("取款失败，余额不足");
        }
    }
    public double queryBalance(){
        return this.balance;
    }
    public void changePassword(int password){
        this.password = password;
    }

}
